function login() {
    var zhanghao = $("#zhanghao").val();
    var mima = $("#mima").val();
    if (zhanghao == "") {
        alert("账号为空，请重新输入!");
    } else if (mima == "") {
        alert("密码为空，请重新输入！");

    } else {
        var user = {
            "username": zhanghao,
            "password": mima
        };
        var jsonData = JSON.stringify(user);

        $.ajax({
            type: "post",
            url: "/user/checkLogin",
            data: jsonData,
            dataType: "json",
            contentType: "application/json;charset=UTF-8",
            success: function (data) {
                if (data.msg == "登录成功") {
                    window.location.href =data.view;
                } else {
                    alert(data.msg);
                }

            }
        });
    }
}

